relocate the remove_weak_pointer to just before we free the page, to be
authorHavoc Pennington <hp@redhat.com>
Fri, 12 Apr 2002 21:52:16 +0000 (21:52 +0000)
committerHavoc Pennington <hp@src.gnome.org>
Fri, 12 Apr 2002 21:52:16 +0000 (21:52 +0000)
2002-04-12  Havoc Pennington  <hp@redhat.com>

* gtk/gtknotebook.c (gtk_notebook_real_remove): relocate the
remove_weak_pointer to just before we free the page, to be sure
it doesn't get re-added. #75282

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtknotebook.c

index 75dc0ddf88c26342c853dc03ad9f8bc5dcf548aa..407d57ea04a161510e229edf4e884d04a503db9e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2002-04-12  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/gtknotebook.c (gtk_notebook_real_remove): relocate the
+       remove_weak_pointer to just before we free the page, to be sure 
+       it doesn't get re-added. #75282
+
 Fri Apr 12 18:32:46 2002  Kristian Rietveld  <kris@gtk.org>
 
        * gtk/gtktreeview.c (gtk_tree_view_real_set_cursor): add
index 75dc0ddf88c26342c853dc03ad9f8bc5dcf548aa..407d57ea04a161510e229edf4e884d04a503db9e 100644 (file)
@@ -1,3 +1,9 @@
+2002-04-12  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/gtknotebook.c (gtk_notebook_real_remove): relocate the
+       remove_weak_pointer to just before we free the page, to be sure 
+       it doesn't get re-added. #75282
+
 Fri Apr 12 18:32:46 2002  Kristian Rietveld  <kris@gtk.org>
 
        * gtk/gtktreeview.c (gtk_tree_view_real_set_cursor): add
index 75dc0ddf88c26342c853dc03ad9f8bc5dcf548aa..407d57ea04a161510e229edf4e884d04a503db9e 100644 (file)
@@ -1,3 +1,9 @@
+2002-04-12  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/gtknotebook.c (gtk_notebook_real_remove): relocate the
+       remove_weak_pointer to just before we free the page, to be sure 
+       it doesn't get re-added. #75282
+
 Fri Apr 12 18:32:46 2002  Kristian Rietveld  <kris@gtk.org>
 
        * gtk/gtktreeview.c (gtk_tree_view_real_set_cursor): add
index 75dc0ddf88c26342c853dc03ad9f8bc5dcf548aa..407d57ea04a161510e229edf4e884d04a503db9e 100644 (file)
@@ -1,3 +1,9 @@
+2002-04-12  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/gtknotebook.c (gtk_notebook_real_remove): relocate the
+       remove_weak_pointer to just before we free the page, to be sure 
+       it doesn't get re-added. #75282
+
 Fri Apr 12 18:32:46 2002  Kristian Rietveld  <kris@gtk.org>
 
        * gtk/gtktreeview.c (gtk_tree_view_real_set_cursor): add
index 75dc0ddf88c26342c853dc03ad9f8bc5dcf548aa..407d57ea04a161510e229edf4e884d04a503db9e 100644 (file)
@@ -1,3 +1,9 @@
+2002-04-12  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/gtknotebook.c (gtk_notebook_real_remove): relocate the
+       remove_weak_pointer to just before we free the page, to be sure 
+       it doesn't get re-added. #75282
+
 Fri Apr 12 18:32:46 2002  Kristian Rietveld  <kris@gtk.org>
 
        * gtk/gtktreeview.c (gtk_tree_view_real_set_cursor): add
index 75dc0ddf88c26342c853dc03ad9f8bc5dcf548aa..407d57ea04a161510e229edf4e884d04a503db9e 100644 (file)
@@ -1,3 +1,9 @@
+2002-04-12  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/gtknotebook.c (gtk_notebook_real_remove): relocate the
+       remove_weak_pointer to just before we free the page, to be sure 
+       it doesn't get re-added. #75282
+
 Fri Apr 12 18:32:46 2002  Kristian Rietveld  <kris@gtk.org>
 
        * gtk/gtktreeview.c (gtk_tree_view_real_set_cursor): add
index bce6cad258b74d228fb78fcc9b37f2dc1c089e78..3f933700fac4bad667c4b377ad4e2261d303421f 100644 (file)
@@ -2387,12 +2387,6 @@ gtk_notebook_real_remove (GtkNotebook *notebook,
     gtk_notebook_switch_focus_tab (notebook, next_list);
 
   page = list->data;
-
-  if (page->last_focus_child)
-    {
-      g_object_remove_weak_pointer (G_OBJECT (page->last_focus_child), (gpointer *)&page->last_focus_child);
-      page->last_focus_child = NULL;
-    }
   
   if (GTK_WIDGET_VISIBLE (page->child) && GTK_WIDGET_VISIBLE (notebook))
     need_resize = TRUE;
@@ -2412,6 +2406,13 @@ gtk_notebook_real_remove (GtkNotebook *notebook,
   
   notebook->children = g_list_remove_link (notebook->children, list);
   g_list_free (list);
+
+  if (page->last_focus_child)
+    {
+      g_object_remove_weak_pointer (G_OBJECT (page->last_focus_child), (gpointer *)&page->last_focus_child);
+      page->last_focus_child = NULL;
+    }
+  
   g_free (page);
 
   if (!notebook->children && notebook->show_tabs &&